home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 October / 1984-10.d64 / quiz master 2 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  108 lines

  1. 10 rem student quiz generator
  2. 20 print"[147]":clr:poke53280,16:poke53281,16:poke808,225:poke649,0:s=54727
  3. 30 dimq$(100),a$(100),b$(100),c$(100),d$(100),e$(100),m$(15),a(100)
  4. 40 gosub840:print"[147]":printspc(12)"  [204][207][193][196][201][206][199][160][196][193][212][193][160][160][160]":print"[144]":gosub390:print""
  5. 50 forx=1toa:printx". "m$(x):next
  6. 60 print"[197]nter number of test":poke649,10:inputx
  7. 70 ifx<1orx>athenprint"invalid range":goto60
  8. 80 n$=m$(x):poke649,0:open15,8,15:print"[147]":open2,8,2,+n$+" file,s,r"
  9. 90 print"     [204][207][193][196][201][206][199][160]";n$;" [209][213][201][218]":print"[144]"
  10. 100 x=0
  11. 110 x=x+1
  12. 120 input#2,q$(x):input#2,a$(x):input#2,b$(x):input#2,c$(x):input#2,d$(x):input#2,e$(x)
  13. 130 ifst and64then150
  14. 140 goto110
  15. 150 close2:poke198,0:l=x:close15:gosub920:print"[147]"
  16. 160 rem test routine
  17. 170 y=1:poke649,10:gosub540
  18. 180 forn=1tol-1:print"[147]":printtab(20-len(n$)/2);n$
  19. 190 s$=str$(n)+". "+q$(a(n)):print:gosub450
  20. 200 rem answer choices
  21. 210 s$=a$(a(n)):gosub450:s$=b$(a(n)):gosub450:s$=c$(a(n)):gosub450
  22. 220 s$=d$(a(n)):gosub450:s$=e$(a(n))
  23. 230 print"[197]nter letter of most correct answer:":poke198,0
  24. 240 inputf$
  25. 250 iflen(f$)<>1thenprint"[197]nter one letter only":goto240
  26. 260 ifasc(f$)<65orasc(f$)>68thenprint"[193]nswer must be [193],[194],[195], or [196]":goto240
  27. 270 ifasc(f$)=asc(s$)thenp=p+1
  28. 280 ifasc(f$)=asc(s$)thenprintspc(9)"  [193]nswer is correct!! ":gosub1030
  29. 290 ifasc(f$)<>asc(s$)then:gosub1060:gosub820
  30. 300 fort=1to4000:next:next
  31. 310 n=n-1
  32. 320 s=int(p/n*100+.5):print"[147][217]ou scored ";s;" %"
  33. 330 ifs>80ands<90thenprint"[211]tudy this section again"
  34. 340 ifs>90ands<100thenprint"[214]ery good, but more study would help"
  35. 350 ifs=100thenprint"[197]xcellent!!  [208]erfect score!!"
  36. 360 fort=1to3000:next
  37. 370 print"[197]nter [210][213][206] to re-start program":poke808,237:end
  38. 380 rem print justify
  39. 390 open15,8,15:open3,8,3,"test titles,s,r":print"[144]"
  40. 400 x=x+1
  41. 410 input#3,m$(x)
  42. 420 ifstatusand64then440
  43. 430 goto400
  44. 440 close3:poke198,0:a=x:close15:print"[147]":return
  45. 450 iflen(s$)<40thenprints$:goto510
  46. 460 x=40:y=1
  47. 470 x=x-1
  48. 480 ifasc(mid$(s$,x,y)+chr$(0))<>32then470
  49. 490 printleft$(s$,x)
  50. 500 z=len(s$):z=z-x:printright$(s$,z)
  51. 510 return
  52. 520 print:printspc(14)"test titles":print:fora=1tox:printa;". ";m$(a):next:return
  53. 530 rem disable cursor controls
  54. 540 ifpeek(830)=133then560
  55. 550 fori=828to977:reada:pokei,a:next
  56. 560 sys828:return
  57. 570 data169,000,133,252,169,080
  58. 580 data133,251,169,164,133,002
  59. 590 data169,083,141,036,003,169
  60. 600 data003,141,037,003,096,152
  61. 610 data072,138,072,165,252,208
  62. 620 data007,032,116,003,169,000
  63. 630 data133,253,166,253,189,000
  64. 640 data002,133,254,198,252,230
  65. 650 data253,104,170,104,168,165
  66. 660 data254,096,160,000,132,252
  67. 670 data165,002,032,210,255,169
  68. 680 data157,032,210,255,032,228
  69. 690 data255,240,251,164,252,133
  70. 700 data254,169,032,032,210,255
  71. 710 data169,157,032,210,255,165
  72. 720 data254,201,013,240,043,201
  73. 730 data020,208,013,192,000,240
  74. 740 data211,136,169,157,032,210
  75. 750 data255,076,118,003,041,127
  76. 760 data201,032,144,196,196,251
  77. 770 data240,192,165,254,153,000
  78. 780 data002,032,210,255,169,000
  79. 790 data133,212,200,076,118,003
  80. 800 data230,252,153,000,002,169
  81. 810 data032,032,210,255,096,013
  82. 820 printspc(10)" [211]orry answer is wrong "
  83. 830 print"[195]orrect choice is: ";s$:return
  84. 840 print"[147]":printspc(13)" [209]uiz [205]aster ":poke53272,23
  85. 850 print"    [212]hese tests are multiple choice."
  86. 860 print"[197]nter the best answer from the choices"
  87. 870 print"given."
  88. 880 print"    [197]nter the number of the test you "
  89. 890 print"have been assigned when the program "
  90. 900 print"calls for it."
  91. 910 fort=1to6000:next:return
  92. 920 rem random gen.
  93. 930 print"[147][215][193][201][212]-- [208]reparing [209]uiz":print"[144]"
  94. 940 forx=1tol
  95. 950 a(x)=int(rnd(.)*l)+1
  96. 960 ifx=1then1000
  97. 970 fory=1tox-1
  98. 980 ifa(y)=a(x)then950
  99. 990 nexty
  100. 1000 nextx
  101. 1010 print"":return
  102. 1020 rem correct answer sound
  103. 1030 s=54272:pokes,150:pokes+1,100:pokes+5,0:pokes+6,240:pokes+24,15:pokes+4,17
  104. 1040 fort=0to200:next:pokes+4,0:return
  105. 1050 rem wrong answer sound
  106. 1060 s=54272:pokes,150:pokes+1,5:pokes+5,0:pokes+6,240:pokes+24,15:pokes+4,17
  107. 1070 fort=0to200:next:pokes+4,0:return
  108.